package com.example.choupaiapp.main.bean;

import android.text.TextUtils;

import com.example.choupaiapp.common.util.SharedPreferencesHelp;

import java.io.Serializable;

/**
 * Created by ASUS on 2019/12/4.
 */

public class ShareFindBean implements Serializable {

    /**
     * msg : success
     * discover : {"id":1,"categoriesId":2,"userId":1,"status":1,"image":"http://media.qmdl666.com/541181/VID2018823125623.mp4","title":"标题","content":"http://media.qmdl666.com/541181/VID2018823125623.mp4","type":2,"likeSum":0,"readSum":0,"shareSum":0,"commentSum":0,"createTime":"2019-12-02 10:49:38","updateTime":"2019-12-03 09:00:14","isDel":0,"nickname":null,"avatar":null,"isAttention":null,"isLike":null}
     * code : 0
     * url : https://www.baidu.com?id=1
     */

    private String msg;
    private DiscoverBean discover;
    private int code;
    private String url;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public DiscoverBean getDiscover() {
        return discover;
    }

    public void setDiscover(DiscoverBean discover) {
        this.discover = discover;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getUrl() {
        UserInfoBean mUserInfoBean = (UserInfoBean) SharedPreferencesHelp.getBean("userInfo");
        if(mUserInfoBean!=null){
            return url + "&&inviteCode=" + mUserInfoBean.getUser().getInviteCode();
        }else{
            return url;
        }
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public static class DiscoverBean implements Serializable{
        /**
         * id : 1
         * categoriesId : 2
         * userId : 1
         * status : 1
         * image : http://media.qmdl666.com/541181/VID2018823125623.mp4
         * title : 标题
         * content : http://media.qmdl666.com/541181/VID2018823125623.mp4
         * type : 2
         * likeSum : 0
         * readSum : 0
         * shareSum : 0
         * commentSum : 0
         * createTime : 2019-12-02 10:49:38
         * updateTime : 2019-12-03 09:00:14
         * isDel : 0
         * nickname : null
         * avatar : null
         * isAttention : null
         * isLike : null
         */

        private int id;
        private int categoriesId;
        private int userId;
        private int status;
        private String image;
        private String title;
        private String content;
        private int type;
        private int likeSum;
        private int readSum;
        private int shareSum;
        private int commentSum;
        private String createTime;
        private String updateTime;
        private int isDel;
        private Object nickname;
        private Object avatar;
        private Object isAttention;
        private Object isLike;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getCategoriesId() {
            return categoriesId;
        }

        public void setCategoriesId(int categoriesId) {
            this.categoriesId = categoriesId;
        }

        public int getUserId() {
            return userId;
        }

        public void setUserId(int userId) {
            this.userId = userId;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getImage() {
            return image;
        }

        public void setImage(String image) {
            this.image = image;
        }

        public String getTitle() {
            if (!TextUtils.isEmpty(title)) {
                return title;
            }
            return ".";
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public int getLikeSum() {
            return likeSum;
        }

        public void setLikeSum(int likeSum) {
            this.likeSum = likeSum;
        }

        public int getReadSum() {
            return readSum;
        }

        public void setReadSum(int readSum) {
            this.readSum = readSum;
        }

        public int getShareSum() {
            return shareSum;
        }

        public void setShareSum(int shareSum) {
            this.shareSum = shareSum;
        }

        public int getCommentSum() {
            return commentSum;
        }

        public void setCommentSum(int commentSum) {
            this.commentSum = commentSum;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public String getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
        }

        public int getIsDel() {
            return isDel;
        }

        public void setIsDel(int isDel) {
            this.isDel = isDel;
        }

        public Object getNickname() {
            return nickname;
        }

        public void setNickname(Object nickname) {
            this.nickname = nickname;
        }

        public Object getAvatar() {
            return avatar;
        }

        public void setAvatar(Object avatar) {
            this.avatar = avatar;
        }

        public Object getIsAttention() {
            return isAttention;
        }

        public void setIsAttention(Object isAttention) {
            this.isAttention = isAttention;
        }

        public Object getIsLike() {
            return isLike;
        }

        public void setIsLike(Object isLike) {
            this.isLike = isLike;
        }
    }
}
